home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / MacInterface / appleevents.icl < prev    next >
Encoding:
Modula Implementation  |  1997-01-15  |  3.1 KB  |  95 lines  |  [TEXT/3PRM]

  1. implementation module appleevents;
  2.  
  3. TypeApplSignature    :== 0x7369676E;    // 'sign'
  4. KCoreEventClass        :==    0x61657674;    // 'aevt'
  5. KAEMiscStandards    :== 0x6D697363;    // 'misc'
  6. KAEQuitApplication    :==    0x71756974;    // 'quit'
  7. KAEDoScript            :== 0x646F7363;    // 'dosc'
  8. KeyDirectObject        :== 0x2D2D2D2D;    // '----'
  9. TypeChar            :== 0x54455854;    // 'TEXT'
  10. KeyErrorNumber        :== 0x6572726E;    // 'errn'
  11. KeyErrorString        :== 0x65727273;    // 'errs'
  12. TypeLongInteger        :== 0x6C6F6E67;    // 'long'
  13.  
  14. SizeOfAEDesc :== 8;
  15. SizeOfAppleEvent :== 8;
  16.  
  17. KAutoGenerateReturnID :== -1;
  18. KAnyTransactionID :== 0;
  19. KAENoReply :== 1;
  20. KAEWaitReply :== 3;
  21. KAENormalPriority :== 0;
  22. KNoTimeOut :== -2;
  23.  
  24. ::    AEDescPtr :== Int;
  25. ::    AppleEventPtr :== Int;
  26.  
  27. AECreateDesc :: !Int !{#Char} !AEDescPtr -> Int;
  28. AECreateDesc typeCode data result_p
  29.     = code (typeCode=R2L,data=A0,result_p=D0)(error_code=W){
  30.         instruction 0x4868 0x0008    |    pea        8(a0)
  31.         instruction 0x2F28 0x0004    |    move.l    4(a0),-(sp)
  32.         instruction 0x2F00            |    move.l    d0,-(sp)
  33.         instruction 0x303C
  34.         instruction 0x0825
  35.         instruction 0xA816
  36.     }
  37.  
  38. AECreateAppleEvent :: !Int !Int !AEDescPtr !Int !Int !AppleEventPtr -> !Int;
  39. AECreateAppleEvent theAEEventClass theAEEventID target returnID transactionID result_p
  40.     = code (theAEEventClass=R2L,theAEEventID=L,target=L,returnID=W,transactionID=L,result_p=L)(error_code=W){
  41.         instruction 0x303C
  42.         instruction 0x0B14
  43.         instruction 0xA816
  44.     }
  45.  
  46. AEPutParamPtr :: !AppleEventPtr !Int !Int !{#Char} -> Int;
  47. AEPutParamPtr theAppleEvent theAEKeyword typeCode data
  48.     = code (theAppleEvent=R2L,theAEKeyword=L,typeCode=L,data=A0)(error_code=W){
  49.         instruction 0x4868 0x0008    |    pea        8(a0)
  50.         instruction 0x2F28 0x0004    |    move.l    4(a0),-(sp)
  51.         instruction 0x303C
  52.         instruction 0x0A0F
  53.         instruction 0xA816
  54.     }
  55.  
  56. AESend :: !AppleEventPtr !AppleEventPtr !Int !Int !Int !Int !Int -> Int;
  57. AESend theAppleEvent reply sendMode sendPriority timeOutInTicks idleProc filterProc
  58.     = code (theAppleEvent=R2L,reply=L,sendMode=L,sendPriority=W,timeOutInTicks=L,idleProc=L,filterProc=L)(error_code=W){
  59.         instruction 0x303C
  60.         instruction 0x0D17
  61.         instruction 0xA816
  62.     }
  63.  
  64. AEGetIntParamPtr :: !AppleEventPtr !Int !Int -> (!Int,!Int,!Int,!Int);
  65. AEGetIntParamPtr theAppleEvent theAEKeyword desiredType
  66.     = code (theAppleEvent=R14L,theAEKeyword=L,desiredType=L)(error_code=W,typeCode=L,value=L,actualSize=L){
  67.         instruction 0x486F 0x000E            |    pea     14+0(sp)
  68.         instruction 0x486F 0x0016            |    pea        14+4+4(sp)
  69.         instruction 0x2F3C 0x0000 0x0004    |    move.l    #4,-(sp)
  70.         instruction 0x486F 0x0022            |    pea     14+12+8(sp)
  71.         instruction 0x303C
  72.         instruction 0x0E11
  73.         instruction 0xA816
  74.     }
  75.  
  76. AEGetStringParamPtr :: !AppleEventPtr !Int !Int !{#Char} -> (!Int,!Int,!Int);
  77. AEGetStringParamPtr theAppleEvent theAEKeyword desiredType string
  78.     = code (theAppleEvent=R10L,theAEKeyword=L,desiredType=L,string=A0)(error_code=W,typeCode=L,actualSize=L){
  79.         instruction 0x486F 0x000E    |    pea     14+0(sp)
  80.         instruction 0x4868 0x0008    |    pea        8(a0)
  81.         instruction 0x2F28 0x0004    |    move.l    4(a0),-(sp)
  82.         instruction 0x486F 0x001E    |    pea     14+12+4(sp)
  83.         instruction 0x303C
  84.         instruction 0x0E11
  85.         instruction 0xA816
  86.     }
  87.  
  88. AEDisposeDesc :: !AEDescPtr -> Int;
  89. AEDisposeDesc theAEDesc
  90.     = code (theAEDesc=R2L)(error_code=W){
  91.         instruction 0x303C
  92.         instruction 0x0204
  93.         instruction 0xA816
  94.     }
  95.